import { pubRequire } from '@utils/public'
import { Message } from 'element-ui'

/*获取标签分类列表*/
export function getTagCategoryId() {
  return new Promise((resolve, reject) => {
    let url = `/tag-categories/tagCategoryNames`
    pubRequire('get', url, '', (response) => {
      resolve(response)
    })
  })
}

/* 获取大鹏号
 * dpAccounts：大鹏号
 * */
export function getDpNum(dpAccounts) {
  return new Promise((resolve, reject) => {
    let url = '/tags/userIds'
    let obj = { dpAccounts }
    pubRequire(
      'get',
      url,
      obj,
      (response) => {
        resolve(response)
      },
      (response) => {
        Message.warning(response.message)
        resolve([])
      }
    )
  })
}
